<script type="text/javascript" lang="javascript">
jQuery(document).ready(function () {
  
});
function fn_status(status,id){  
  if(status == 1){    
    var msg = "[ WARNING : Update Status] \n\n Are you sure you want to change the status to active?";
  }else{    
    var msg = "[ WARNING : Update Status] \n\n Are you sure you want to change the status to inactive?";
  }
  
  var conf = confirm(msg);
  var url = '<?php __e(site_url($cur_c.'/change_status'));?>/'+status;
	if(conf){    
    bk_frm_id = id;
    bk_frm_mode = 'update_status';
    bk_frm_action = url;
    bk_frm_frm = '<?php __e($frm_name);?>';
		do_submit();
	}
}  
</script>
<?php /*
<!-- h2 stays for breadcrumbs -->
<h2 class="h2bread"><a href="#">Dashboard</a> &raquo; <a href="#" class="active">Print resources</a></h2>
*/ ?>
<div id="main">
  
<?php if($num_rows > 0){ ?>
<br/>
 <?php
  $properties = array(
      'name' => 'btn_add',
      'id' => 'btn_add',
      'class' => 'button-submit',
      'maxlength' => 200,
      'tabindex' => 1,
      'value' => 'Add',
      'onclick' => 'javascript: redirect_page(\''.  site_url($cur_c.'/add').'\');'
  );
  __e(inputbox($properties, true));
  ?>

  <?php
  $properties = array(
      'name' => 'btn_red',
      'id' => 'btn_red',
      'class' => 'button-submit',
      'maxlength' => 200,
      'tabindex' => 1,
      'value' => 'List All',
      'onclick' => 'javascript: redirect_page(\''.  site_url($cur_c).'\');'
  );
  __e(inputbox($properties, true));
  ?>
  
  <form action="<?php __e(site_url($cur_c.'/search'));?>" method="post" name="<?php __e($frm_name);?>_srch" id="<?php __e($frm_name);?>_srch">
  <h3><?php echo $cont_title; ?></h3>
  <div>
    <strong>Search</strong> <input type="text" name="srch_all_flds" id="srch_all_flds" value="" maxlength="255" class="srch_box"/>
    <input type="submit" name="srch_btn" id="srch_btn" value="Search" class="button-submit" onclick=""/>
  </div>
  </form>
  
  <form action="<?php __e($frm_action);?>" method="post" name="<?php __e($frm_name);?>" id="<?php __e($frm_name);?>" class="frmreg" enctype="multipart/form-data">
    <input type="hidden" name="frm_cur" name="frm_cur" value="<?php __e( $this->uri->uri_string() ); ?>" />
    <input type="hidden" name="frm_mode" id="frm_mode" value="" />
    <input type="hidden" name="frm_id" id="frm_id" value="" />
    
  <?php $this->load->view('admin_messages',$msg_info); ?>
      
    <div class="srch_cnt">
      <strong><?php __e($num_rows);?></strong> records found <?php __e(isset($pagination_link)?$pagination_link:'');?>
    </div>
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
      <thead>
        <tr>
          <th align="left" width="2%">&nbsp;</th>
          <th align="left" width="5%">ID</th>
          <th align="left" width="8%">Year</th>
          <th align="left" width="10%">Vol No.</th>
          <th align="left" width="8%">Vol Issue</th>
          <th align="left" width="15%">Vol Date</th>
          <th align="left" width="8%">Price</th>
          <th align="left" width="8%">Pages</th>
          <th align="left" width="12%">Action</th>
        </tr>
      </thead>
      <tbody>
      <?php foreach ($list as $key => $val){ ?>

            <tr class="<?php __e( ($key%2)?'odd':'' ); ?>">
              <td align="left" valign="top"><?php /*<input type="checkbox" class="chk" name="chk_id[]" id="chk_id_<?php __e($val['os_journals_id']);?>" value="<?php __e($val['os_journals_id']);?>"/>*/ ?></td>        
              <td align="left" valign="top"><?php __e($val['os_volume_id']);?></td>
              <td align="left" valign="top"><?php __e($val['os_volume_year']);?></td>
              <td align="left" valign="top"><?php __e($val['os_volume_no']);?></td>             
              <td align="left" valign="top"><?php __e($val['os_volume_issue_no']);?></td>             
              <td align="left" valign="top"><?php __e($val['os_volume_issue_dt_range']);?></td>             
              <td align="left" valign="top"><?php __e($val['os_volume_price']);?></td>             
              <td align="left" valign="top"><?php __e($val['os_volume_pages']);?></td>
              <td align="left" valign="top" class="action">                
                <?php /* <a href="#" class="view">View</a>&nbsp; */ ?>
                <a href="<?php __e(site_url($cur_c. '/edit/'. $val['os_volume_id']));?>" class="edit">Edit</a>&nbsp;
                <?php /* <a href="#" class="delete">Delete</a>&nbsp; */ ?>                
                <?php if($val['os_volume_status'] == 1){ ?>
                <a class="stact" href="javascript:;" onclick="fn_status('0','<?php __e($val['os_volume_id']);?>');">Active</a>&nbsp;
                <?php }else{ ?>
                <a class="stina" href="javascript:;" onclick="fn_status('1','<?php __e($val['os_volume_id']);?>');">Inactive</a>&nbsp;
                <?php }?>
              </td>
              
            </tr>

      <?php }/*</foreach ($list as $key => $val)>*/ ?>

      </tbody>                           
    </table>  
    <br/>
  </form>
  <?php }else{ /*</else:if($num_rows > 0)>*/ ?>
  <h3><?php __e(LIST_NO_DATA_MSG);?></h3>	

  <?php
  $properties = array(
      'name' => 'btn_red',
      'id' => 'btn_red',
      'class' => 'button-submit',
      'maxlength' => 200,
      'tabindex' => 1,
      'value' => 'Back to listing',
      'onclick' => 'javascript: redirect_page(\''.  site_url($cur_c).'\');'
  );
  __e(inputbox($properties, true));
  ?>

  <?php
  $properties = array(
      'name' => 'btn_add',
      'id' => 'btn_add',
      'class' => 'button-submit',
      'maxlength' => 200,
      'tabindex' => 1,
      'value' => 'Add',
      'onclick' => 'javascript: redirect_page(\''.  site_url($cur_c.'/add').'\');'
  );
  __e(inputbox($properties, true));
  ?>

  <?php }/*</if($num_rows > 0)>*/ ?>
</div>
<!-- // #main -->

